<template>
<el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      label="角色名"
      width="180">
      <template slot-scope="scope">
        
        <span style="margin-left: 10px">{{ scope.row.rname }}</span>
      </template>
    </el-table-column>
    <el-table-column
      label="description"
      width="180">
      <template slot-scope="scope">
        <div slot="reference" class="name-wrapper">
        <p >{{ scope.row.name }}</p>
        </div>
      </template>
    </el-table-column>
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
          size="mini"
          @click="handleEdit(scope.$index, scope.row)">分配权限</el-button>
        
      </template>
    </el-table-column>
    </el-table>
    
    
    
</template>
<script>
export default {
    data(){
      return {

         tableData: [{
          rname: '普通用户',
          name: 'consumer',
        }, {
          rname: '超级管理员',
          name: 'admin ',
        }, {
          rname: '排片表管理员',
          name: 'orderman',
        }, {
          rname: '电影管理员',
          name: 'movieman',
        }]
      };
    },
    methods:{
        handleEdit(index) {
        //console.log(index);
        let id=index+1
        console.log(id)
        this.$router.push({
            path:'/permsRole',
            query:{
                id:id
            }
            })
            

      }
      
    },
    mounted:function(){
        
    }
}
</script>
<style scoped>

</style>